#include "roadef.h"
#include <string.h>
#include <cstdio>
#include <cstdlib>

int main(int argc, char **argv) {
        int c,temp=300,vmax=100,pmax=1,rand=1;
        bool verb = false;
	string modele,in,out="sortie.txt";

        if(argc>1)
            for(int i=0;i<argc;i++)
            if(string(argv[i])==string("-name")){
                std::cout<<"J35"<<std::endl;
                return 1;
            }

        while ((c = getopt(argc, argv, "vt:p:i:o:s:")) != -1)
		switch (c){
                case 'v' :
                    verb = true;
                    break;
		case 't':
                     temp = atoi(optarg);
		     break;
		case 'p':
		     modele = optarg;
		     break;
		case 'i':
		     in = optarg;
		     break;
		case 'o':
		     out = optarg;
		     break;
		case 's':
		     rand = atoi(optarg);
		     break;
		default:
		     abort();
		   };

	if(modele.empty() || in.empty())
                cout<<"./checker -t time_limit -p instance_filename -i original_solution_filename -o new_solution_filename -name -s seed -v"<<endl;
	else{
	    roadef road(modele,in, vmax,rand,pmax,temp);
	    road.algo();
	    
	    if(verb)
		road.printRes();
	    road.saveFile(out);
	}
  return 0;
}
//rR8zjvM5
